Optimal. Leaf size=181 \[ 4 a^4 A x+\frac {a^4 (52 A+35 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}+\frac {5 a^4 (4 A+7 C) \tan (c+d x)}{8 d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}-\frac {(12 A-35 C) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.24, antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 6, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.194, Rules used = {4172, 4002,
3999, 3852, 8, 3855} \begin {gather*} \frac {5 a^4 (4 A+7 C) \tan (c+d x)}{8 d}+\frac {a^4 (52 A+35 C) \tanh ^{-1}(\sin (c+d x))}{8 d}-\frac {(12 A-35 C) \tan (c+d x) \left (a^4 \sec (c+d x)+a^4\right )}{24 d}+4 a^4 A x-\frac {(12 A-7 C) \tan (c+d x) \left (a^2 \sec (c+d x)+a^2\right )^2}{12 d}-\frac {a (4 A-C) \tan (c+d x) (a \sec (c+d x)+a)^3}{4 d}+\frac {A \sin (c+d x) (a \sec (c+d x)+a)^4}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 3999
Rule 4002
Rule 4172
Rubi steps
\begin {align*} \int \cos (c+d x) (a+a \sec (c+d x))^4 \left (A+C \sec ^2(c+d x)\right ) \, dx &=\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}+\frac {\int (a+a \sec (c+d x))^4 (4 a A-a (4 A-C) \sec (c+d x)) \, dx}{a}\\ &=\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}+\frac {\int (a+a \sec (c+d x))^3 \left (16 a^2 A-a^2 (12 A-7 C) \sec (c+d x)\right ) \, dx}{4 a}\\ &=\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}+\frac {\int (a+a \sec (c+d x))^2 \left (48 a^3 A-a^3 (12 A-35 C) \sec (c+d x)\right ) \, dx}{12 a}\\ &=\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}-\frac {(12 A-35 C) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d}+\frac {\int (a+a \sec (c+d x)) \left (96 a^4 A+15 a^4 (4 A+7 C) \sec (c+d x)\right ) \, dx}{24 a}\\ &=4 a^4 A x+\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}-\frac {(12 A-35 C) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d}+\frac {1}{8} \left (5 a^4 (4 A+7 C)\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{8} \left (a^4 (52 A+35 C)\right ) \int \sec (c+d x) \, dx\\ &=4 a^4 A x+\frac {a^4 (52 A+35 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}-\frac {(12 A-35 C) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d}-\frac {\left (5 a^4 (4 A+7 C)\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{8 d}\\ &=4 a^4 A x+\frac {a^4 (52 A+35 C) \tanh ^{-1}(\sin (c+d x))}{8 d}+\frac {A (a+a \sec (c+d x))^4 \sin (c+d x)}{d}+\frac {5 a^4 (4 A+7 C) \tan (c+d x)}{8 d}-\frac {a (4 A-C) (a+a \sec (c+d x))^3 \tan (c+d x)}{4 d}-\frac {(12 A-7 C) \left (a^2+a^2 \sec (c+d x)\right )^2 \tan (c+d x)}{12 d}-\frac {(12 A-35 C) \left (a^4+a^4 \sec (c+d x)\right ) \tan (c+d x)}{24 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(379\) vs. \(2(181)=362\).
time = 2.39, size = 379, normalized size = 2.09 \begin {gather*} \frac {a^4 \left (C+A \cos ^2(c+d x)\right ) \sec ^8\left (\frac {1}{2} (c+d x)\right ) (1+\sec (c+d x))^4 \left (-24 (52 A+35 C) \cos ^4(c+d x) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+\sec (c) (288 A d x \cos (c)+192 A d x \cos (c+2 d x)+192 A d x \cos (3 c+2 d x)+48 A d x \cos (3 c+4 d x)+48 A d x \cos (5 c+4 d x)-288 A \sin (c)-480 C \sin (c)+24 A \sin (d x)+105 C \sin (d x)+24 A \sin (2 c+d x)+105 C \sin (2 c+d x)+288 A \sin (c+2 d x)+544 C \sin (c+2 d x)-96 A \sin (3 c+2 d x)-96 C \sin (3 c+2 d x)+30 A \sin (2 c+3 d x)+81 C \sin (2 c+3 d x)+30 A \sin (4 c+3 d x)+81 C \sin (4 c+3 d x)+96 A \sin (3 c+4 d x)+160 C \sin (3 c+4 d x)+6 A \sin (4 c+5 d x)+6 A \sin (6 c+5 d x))\right )}{1536 d (A+2 C+A \cos (2 (c+d x)))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.78, size = 237, normalized size = 1.31
method | result | size |
derivativedivides | \(\frac {A \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{4} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 A \,a^{4} \tan \left (d x +c \right )-4 a^{4} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+6 A \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 a^{4} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A \,a^{4} \left (d x +c \right )+4 a^{4} C \tan \left (d x +c \right )+A \,a^{4} \sin \left (d x +c \right )+a^{4} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(237\) |
default | \(\frac {A \,a^{4} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{4} C \left (-\left (-\frac {\left (\sec ^{3}\left (d x +c \right )\right )}{4}-\frac {3 \sec \left (d x +c \right )}{8}\right ) \tan \left (d x +c \right )+\frac {3 \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{8}\right )+4 A \,a^{4} \tan \left (d x +c \right )-4 a^{4} C \left (-\frac {2}{3}-\frac {\left (\sec ^{2}\left (d x +c \right )\right )}{3}\right ) \tan \left (d x +c \right )+6 A \,a^{4} \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )+6 a^{4} C \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+4 A \,a^{4} \left (d x +c \right )+4 a^{4} C \tan \left (d x +c \right )+A \,a^{4} \sin \left (d x +c \right )+a^{4} C \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{d}\) | \(237\) |
risch | \(4 a^{4} A x -\frac {i A \,a^{4} {\mathrm e}^{i \left (d x +c \right )}}{2 d}+\frac {i A \,a^{4} {\mathrm e}^{-i \left (d x +c \right )}}{2 d}-\frac {i a^{4} \left (12 A \,{\mathrm e}^{7 i \left (d x +c \right )}+81 C \,{\mathrm e}^{7 i \left (d x +c \right )}-96 A \,{\mathrm e}^{6 i \left (d x +c \right )}-96 C \,{\mathrm e}^{6 i \left (d x +c \right )}+12 A \,{\mathrm e}^{5 i \left (d x +c \right )}+105 C \,{\mathrm e}^{5 i \left (d x +c \right )}-288 A \,{\mathrm e}^{4 i \left (d x +c \right )}-480 C \,{\mathrm e}^{4 i \left (d x +c \right )}-12 A \,{\mathrm e}^{3 i \left (d x +c \right )}-105 C \,{\mathrm e}^{3 i \left (d x +c \right )}-288 A \,{\mathrm e}^{2 i \left (d x +c \right )}-544 C \,{\mathrm e}^{2 i \left (d x +c \right )}-12 \,{\mathrm e}^{i \left (d x +c \right )} A -81 C \,{\mathrm e}^{i \left (d x +c \right )}-96 A -160 C \right )}{12 d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4}}+\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) A}{2 d}+\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{8 d}-\frac {13 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) A}{2 d}-\frac {35 a^{4} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{8 d}\) | \(332\) |
norman | \(\frac {-4 a^{4} A x +16 a^{4} A x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-20 a^{4} A x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+20 a^{4} A x \left (\tan ^{8}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-16 a^{4} A x \left (\tan ^{10}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+4 a^{4} A x \left (\tan ^{12}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {5 a^{4} \left (4 A +7 C \right ) \left (\tan ^{11}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{4 d}-\frac {a^{4} \left (44 A +93 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{4 d}+\frac {7 a^{4} \left (60 A +73 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}+\frac {a^{4} \left (-203 C +12 A \right ) \left (\tan ^{7}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}-\frac {a^{4} \left (53 C +204 A \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{6 d}+\frac {a^{4} \left (385 C +156 A \right ) \left (\tan ^{9}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{12 d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right ) \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{5}}-\frac {a^{4} \left (52 A +35 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{8 d}+\frac {a^{4} \left (52 A +35 C \right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{8 d}\) | \(339\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.30, size = 296, normalized size = 1.64 \begin {gather*} \frac {192 \, {\left (d x + c\right )} A a^{4} + 64 \, {\left (\tan \left (d x + c\right )^{3} + 3 \, \tan \left (d x + c\right )\right )} C a^{4} - 3 \, C a^{4} {\left (\frac {2 \, {\left (3 \, \sin \left (d x + c\right )^{3} - 5 \, \sin \left (d x + c\right )\right )}}{\sin \left (d x + c\right )^{4} - 2 \, \sin \left (d x + c\right )^{2} + 1} - 3 \, \log \left (\sin \left (d x + c\right ) + 1\right ) + 3 \, \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 12 \, A a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} - 72 \, C a^{4} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 144 \, A a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 24 \, C a^{4} {\left (\log \left (\sin \left (d x + c\right ) + 1\right ) - \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 48 \, A a^{4} \sin \left (d x + c\right ) + 192 \, A a^{4} \tan \left (d x + c\right ) + 192 \, C a^{4} \tan \left (d x + c\right )}{48 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.27, size = 171, normalized size = 0.94 \begin {gather*} \frac {192 \, A a^{4} d x \cos \left (d x + c\right )^{4} + 3 \, {\left (52 \, A + 35 \, C\right )} a^{4} \cos \left (d x + c\right )^{4} \log \left (\sin \left (d x + c\right ) + 1\right ) - 3 \, {\left (52 \, A + 35 \, C\right )} a^{4} \cos \left (d x + c\right )^{4} \log \left (-\sin \left (d x + c\right ) + 1\right ) + 2 \, {\left (24 \, A a^{4} \cos \left (d x + c\right )^{4} + 32 \, {\left (3 \, A + 5 \, C\right )} a^{4} \cos \left (d x + c\right )^{3} + 3 \, {\left (4 \, A + 27 \, C\right )} a^{4} \cos \left (d x + c\right )^{2} + 32 \, C a^{4} \cos \left (d x + c\right ) + 6 \, C a^{4}\right )} \sin \left (d x + c\right )}{48 \, d \cos \left (d x + c\right )^{4}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.51, size = 253, normalized size = 1.40 \begin {gather*} \frac {96 \, {\left (d x + c\right )} A a^{4} + \frac {48 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} + 1} + 3 \, {\left (52 \, A a^{4} + 35 \, C a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - 3 \, {\left (52 \, A a^{4} + 35 \, C a^{4}\right )} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {2 \, {\left (84 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} + 105 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{7} - 276 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} - 385 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{5} + 300 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} + 511 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{3} - 108 \, A a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 279 \, C a^{4} \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )\right )}}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )}^{4}}}{24 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 2.79, size = 246, normalized size = 1.36 \begin {gather*} \frac {A\,a^4\,\sin \left (c+d\,x\right )}{d}+\frac {8\,A\,a^4\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {13\,A\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}+\frac {35\,C\,a^4\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{4\,d}+\frac {4\,A\,a^4\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )}+\frac {A\,a^4\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {20\,C\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,\cos \left (c+d\,x\right )}+\frac {27\,C\,a^4\,\sin \left (c+d\,x\right )}{8\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {4\,C\,a^4\,\sin \left (c+d\,x\right )}{3\,d\,{\cos \left (c+d\,x\right )}^3}+\frac {C\,a^4\,\sin \left (c+d\,x\right )}{4\,d\,{\cos \left (c+d\,x\right )}^4} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________